import com.jfinal.server.JettyServerHost;

/**
 * Created with IntelliJ IDEA.
 * User: shoko
 * Date: 13-11-17
 * Time: 下午3:37
 * To change this template use File | Settings | File Templates.
 */
public class Server {


/*java -classpath "../lib/c3p0-0.9.1.2.jar;../lib/commons-beanutils.jar;../lib/cpdetector_1.0.5.jar;../lib/freemarker-2.3.18.jar;../lib/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar;../lib/jetty-server-8.1.8.jar;../lib/JFinal-bin-with-src-1.5.jar;../lib/jfinal-ext-2.1-1.5-with-src.jar;../lib/JspChicoTag.jar;../lib/log4j-1.2.16.jar;../lib/mongo-2.10.1.jar;../lib/mysql-connector-java-5.1.20-bin.jar;../lib/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar;" Server*/

    /**
     * @param args
     */
    public static void main(String[] args) {
        String webAppDir = Server.class.getResource("").getPath().replace("/WEB-INF/classes/", "");
        int port = 8090;
        String content = "/";
        if (args != null && args.length > 0) {
            try {
                port = Integer.parseInt(args[0]);
                content = args[1];
            } catch (Exception e) {
            }
        }
//        String ip = "127.0.0.1";
        String ip = "118.193.196.149";
//        String ip = "118.193.251.12";//118.193.196.149

        try {
//            JFinal.start(webAppDir.substring(1), port,content, 10);
//            JFinal.start("G:/baidupan/kuaipan/project/ai/idea/out/artifacts/jfinalJsp_war_exploded", port,content, 10);
//            new JettyServerHost("G:/baidupan/kuaipan/project/ai/idea/out/artifacts/jfinalJsp_war_exploded", port,content, 10,"192.168.1.4").start();
            new JettyServerHost("D:/javaweb/jfinalQ_blog", port, content, 10, ip).start();
//            System.out.println(webAppDir);
//            JFinal.start("G:/baidupan/快盘/project/ai/idea/out/artifacts/jfinalJsp_war_exploded", port,content, 10);
        } catch (Exception e) {
			new JettyServerHost("D:/javaweb/jfinalQ_blog", port, content, 10, ip).start();
            e.printStackTrace();
        }
    }
}
